{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "import struct"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2051, 10000, 28, 28)\n",
      "7840000\n"
     ]
    }
   ],
   "source": [
    "with open('t10k-images-idx3-ubyte','rb') as f:\n",
    "    buffer = f.read(4*4)\n",
    "    head = struct.unpack('>iiii',buffer)\n",
    "    print(head)\n",
    "    length = head[1]*head[2]*head[3]\n",
    "    print(length)\n",
    "    buffer = f.read(length)\n",
    "    data_test_imgs = struct.unpack('>{}B'.format(length),buffer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7840000"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data_test_imgs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tuple"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(data_test_imgs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10000, 28, 28)"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "imgs = np.reshape(data_test_imgs,(head[1],head[2],head[3]))\n",
    "imgs.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB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vVTp04l672U60fPeeSRR2przz33XKPnrsORHSgEYQcKQdiBQhB2oBCEHSgEYQcKQdiBQtDPjqRcP3rOvffeW1tbtmxZctt58+Yl688//3xHbeqGOXPmJOsrVqxI1o8fP97N5owJR3agEIQdKARhBwpB2IFCEHagEIQdKARhBwpBP3vhcnOvnzt3LllfunRpsn7rrbfW1g4dOpTcdtGiRcn6hg0bkvWjR4/W1q688srktvv27UvWZ82alaxPnz49WR8cHEzWeyF7ZLf9gu3DtneOeGym7c22d1e3M3rbTABNjeU0/nuSHrjksbWStkTEIklbqu8B9LFs2CPiFUmXng+tlLS+ur9e0kNdbheALuv0PfvciBiSpIgYsl17obDtNZLWdLgfAF3S8w/oImKdpHWSZLvZanoAOtZp19sh2wOSVN0e7l6TAPRCp2HfKOmx6v5jkn7UneYA6JXsabztFyXdJ2m27UFJ35T0rKQf2l4t6beSHu1lI9G5yy5L/3+e60efMmVKsv7oo+lffWp+9SuuuCK57bRp05L13Jz2qX97btslS5Yk6/v370/Wjx07lqxffvn4X+KS3WNErKopfaHLbQHQQ1wuCxSCsAOFIOxAIQg7UAjCDhSCIa5jlOqqiUhfGJjr/sptn6unhqmeP38+uW3OE088kay/8847yfqZM2dqawsWLEhum+uayw2RTb0uuSmyc8tBnz17NlnPDXGdPHlybS3X3dnpUtUc2YFCEHagEIQdKARhBwpB2IFCEHagEIQdKEQx/ey5IY1N+7pTmi57nJvuuUlf+qpVdYMah1133XXJ+rZt25L1iRMn1tauueaa5Lbvvvtusp6aKlqSZs+eXVvLDZ/NveY5uWsrrrrqqtpabgrt7du3d9amjrYC8KlD2IFCEHagEIQdKARhBwpB2IFCEHagEMX0szfpJ5fS/aa5PtVcP3iubU360R9//PFkffHixcl6bsrkVF+2lL6+Ibds8oEDB5L1XF956vqGDz74ILltbix90+s2UlasWJGs088OIImwA4Ug7EAhCDtQCMIOFIKwA4Ug7EAhPlX97Ln+7JRcv2eu3zTVZ9t0vHrOvHnzkvWHH364tpbry969e3eyPnXq1GQ9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1wssuOSNo34vvZ1WP9qF/b1q/tkmhbp7rZthvrCuM6nv1jO7e3RsTS1hqQ0K9t69d2SbStU+PVNk7jgUIQdqAQbYd9Xcv7T+nXtvVruyTa1qlxaVur79kBjJ+2j+wAxglhBwrRSthtP2D7V7b32F7bRhvq2N5r+41qGepW16er1tA7bHvniMdm2t5se3d1O+oaey21rS+W8U4sM97qa9f28ufj/p7d9gRJv5b0RUmDkl6TtCoifjmuDalhe6+kpRHR+gUYtv9I0klJ/3pxaS3b/yDpaEQ8W/1HOSMi/qZP2vaMPuEy3j1qW90y43+uFl+7bi5/3ok2jux3StoTEb+JiLOSfiBpZQvt6HsR8Yqko5c8vFLS+ur+eg3/sYy7mrb1hYgYioht1f0Tki4uM97qa5do17hoI+zzJe0f8f2g+mu995D0M9uv217TdmNGMffiMlvV7ZyW23Op7DLe4+mSZcb75rXrZPnzptoI+2hL0/RT/9/yiPhDSX8i6WvV6SrG5tuSPqvhNQCHJH2rzcZUy4y/JOmpiDjeZltGGqVd4/K6tRH2QUnXj/j+M5IOttCOUUXEwer2sKQNGn7b0U8OXVxBt7o93HJ7/k9EHIqI8xFxQdJ31OJrVy0z/pKk70fEy9XDrb92o7VrvF63NsL+mqRFthfaniTpK5I2ttCOj7E9pfrgRLanSPqS+m8p6o2SHqvuPybpRy225Xf0yzLedcuMq+XXrvXlzyNi3L8kPajhT+TflvS3bbShpl2/J+l/qq83226bpBc1fFr3kYbPiFZLmiVpi6Td1e3MPmrbv2l4ae8dGg7WQEtt+7yG3xrukLS9+nqw7dcu0a5xed24XBYoBFfQAYUg7EAhCDtQCMIOFIKwA4Ug7EAhCDtQiP8Far/487PZGg4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAA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ichREXm8iB7SiMhxEflYRPYXvT9dsoder4gcHHFZo4hsFZEjyftR99grqLcnRORvyX23X0RWF9TbPBHZJiKHROQTEflZcnmh953RV0Xut4r/zy4iYwEcBvDPALoA7AawRlU/rWgjKUTkOIBlqlr4CzBEpBVAP4DNqnpHctl/ADirqhuTP5TTVPXfqqS3JwD0F72Nd7Jb0eyR24wDuB/Av6DA+87o64eowP1WxJF9OYCjqvq5ql4F8HsAbQX0UfVU9T0AZ6+7uA3ApuTjTRj+Zam4lN6qgqp2q+q+5OM+AF9tM17ofWf0VRFFhH0OgL+O+LwL1bXfuwL4s4jsFZH2opsZxc2q2g0M//IAmFlwP9cLbuNdSddtM141910525/HKiLso504rJrm/1aq6j8A+D6AnyYPV6k0JW3jXSmjbDNeFcrd/jxWEWHvAjBvxOdzAZwsoI9RqerJ5H0vgNdQfVtR93y1g27yvrfgfv6umrbxHm2bcVTBfVfk9udFhH03gGYR+Z6I1AL4EYAtBfTxDSIyKXniBCIyCcAqVN9W1FsArE0+Xgvg9QJ7+Zpq2cY7bZtxFHzfFb79uapW/A3Aagw/I38MwL8X0UNKXwsBfJS8fVJ0bwBewfDDugEMPyJ6GMBNADoBHEneN1ZRb/8N4GMABzAcrNkF9fZPGP7X8ACA/cnb6qLvO6OvitxvfLkskRN8BR2REww7kRMMO5ETDDuREww7kRMMO5ETDDuRE/8PuJrEaiF6TGwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAPSElEQVR4nO3dbYiV95nH8d/lw2h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hYb/mwc32tOrcdK3aW6v2JdFbtRrVGy/jgSAIOxBEs8Oe/6Xu5mvV3lq1L4neqtWQ3pr6nh1A4zT7yA6gQQg7EERTwm5mj5vZ/5rZQTN7sRk95DGzI2b2npnta/b6dNkaev1m1jNq2xwz22pmH2aX466x16Te1prZX7Lnbp+ZrWhSbwvNbLuZHTCz983sB9n2pj53ib4a8rw1/D27mU2U9H+S/kFSr6Tdkla7+58b2kgOMzsiaZm7N/0LGGb2d5LOSPq1u9+Xbfs3SQPu/nL2H+Vsd//nFultraQzzV7GO1utaMHoZcYlPSnpn9TE5y7R1z+qAc9bM47sHZIOuvthd78kaYOklU3oo+W5+w5JA1dtXilpXXZ9nUb+WBoup7eW4O597r43uz4o6fNlxpv63CX6aohmhP0OScdG/d6r1lrv3SX93szeNbOuZjczjvnu3ieN/PFImtfkfq5WuIx3I121zHjLPHfVLH9eVjPCPt5SUq00/veouz8k6RuSvpe9XEVlKlrGu1HGWWa8JVS7/HlZzQh7r6SFo37/sqTjTehjXO5+PLvsl7RJrbcU9YnPV9DNLvub3M8XWmkZ7/GWGVcLPHfNXP68GWHfLekuM/uKmbVJ+pakLU3o4xpmNj374ERmNl3S19V6S1FvkbQmu75G0uYm9jJGqyzjnbfMuJr83DV9+XN3b/iPpBUa+UT+kKR/aUYPOX0tlvSn7Of9Zvcmab1GXtYNaeQV0XOS/kbSNkkfZpdzWqi31yS9J2m/RoK1oEm9dWrkreF+SfuynxXNfu4SfTXkeePrskAQfIMOCIKwA0EQdiAIwg4EQdiBIAg7EARhB4L4f/aYpQFPBL83AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmU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8Du3buT9Weffba09s4771TdzpTs2bOn7n2PHTtWYSfgyA4EQdiBIAg7EARhB4Ig7EAQhB0IgrADQZi7t+7JzC5K+mTCpoWSLrWsganp1N46tS+J3upVZW9/7u5/VqvQ0rD/0ZObHezUc9N1am+d2pdEb/VqVW+8jQeCIOxAEO0Oe2+bnz+lU3vr1L4keqtXS3pr62d2AK3T7iM7gBYh7EAQbQm7mb1gZv9tZqfN7KV29FDGzPrM7JiZHWn3+nTFGnpDZnZ8wrb5ZrbPzE4VlzXX2GtTb6+a2UDx2h0xsw1t6m2Fmf3WzE6a2Udm9u1ie1tfu0RfLXndWv6Z3cymS/ofSX8nqV/SB5I2u/uJljZSwsz6JK1x97b/AMPM/kbSiKSfuftfFNv+WdJld3+t+B9lj7v/Y4f09qqkkXYv412sVrR04jLjkl6U9Pdq42uX6OvrasHr1o4j+1pJp939jLvfkvQLSRvb0EfHc/cDki7ft3mjpF3F9V0a/8fSciW9dQR3H3T3w8X1q5LuLjPe1tcu0VdLtCPsj0o6O+F2vzprvXeX9BszO2Rm29vdTA2L3X1QGv/HI2lRm/u5X3YZ71a6b5nxjnnt6ln+vFHtCHutpaQ6afzvGXf/S0nrJX2reLuKyZnUMt6tUmOZ8Y5Q7/LnjWpH2PslrZhwe7mkc23ooyZ3P1dcDkl6S523FPWFuyvoFpdDbe7n/3XSMt61lhlXB7x27Vz+vB1h/0DSKjP7kpl1SfqGpPpPQVohM5tTfHEiM5sj6SvqvKWo90jaWlzfKuntNvZyj05ZxrtsmXG1+bVr+/Ln7t7yP0kbNP6N/P9K+qd29FDS12OS/qv4+6jdvUl6U+Nv625r/B3RNkkLJO2XdKq4nN9Bve2WdEzSUY0Ha2mbevtrjX80PCrpSPG3od2vXaKvlrxu/FwWCIJf0AFBEHYgCMIOBEHYgSAIOxAEYQeCIOxAEP8HoX3d20hxV5QAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAATHElEQVR4nO3dW2xV55UH8P+C4ISbBQYD5mJwCo6GTBKDCBoFcplUUwUeQnjoqDxEmSQaV1ErNVLFDMo8NC8ToZnpdPowquJOUWnUSYXSRiESGYFQJYY8NHEixpAAMbeAsbEBBzCXBBuvefB25BDvtZyzzzn71Ov/k5Dts/z5LG+fxT7nrP19n6gqiGj8m5B3AkRUHix2oiBY7ERBsNiJgmCxEwVxRznvTET41n8JTJ06NTU2YYL9/7mIZIp7rPEDAwPm2KtXr2a676hUddSDnqnYReQJAD8HMBHAf6nq1iw/LwvvQT04OGjGszyo825f3nfffakx6z8CAKiqqjLjEydOLCinYXfeeWdq7Pz58+bYffv2Zbpv+qqCn8aLyEQA/wlgHYDlADaJyPJiJUZExZXlNftqAMdU9YSq3gTwOwAbipMWERVblmJfAODMiK87ktu+QkSaRaRVRFoz3BcRZZTlNftoL3K/9uJVVVsAtAB8g44oT1nO7B0AFo34eiGAzmzpEFGpZCn29wEsE5EGEakC8D0AO4uTFhEVm2RpG4nIegD/gaHW2zZV/Wfn+0v2ND5rP9iT5ThNnz7djD/++ONmfOXKlWZ83bp1qbGjR4+aY73fa9q0aWZ81qxZZvzChQupscmTJ5tjvbbf22+/bcZ37kw/95w+fdoc++esJH12Vd0FYFeWn0FE5cHLZYmCYLETBcFiJwqCxU4UBIudKAgWO1EQmfrs3/jOcrxc1uvDZzkOzc3NZryxsdGMe/3kI0eOmHGrF97U1GSO/fzzz824N0XWm3N+5cqV1Nj169fNsbW1tZnuu6GhoeD73rJlixnv7Kzci0XT+uw8sxMFwWInCoLFThQEi50oCBY7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cAr2PoaV0/hp4RPQ9gFoC9ANqTjzUVlNtrGNrauw1DhVWXU25rMfTSsA3AgeTf+ryPnZFXWY4bL5clCoJX0BEFwWInCoLFThQEi50oCBY7URAsdqIgWOxEQfw//M9nRNPvb2AAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "for i in range(5):\n",
    "    plt.imshow(imgs[i],cmap='gray')\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2051, 60000, 28, 28)\n",
      "47040000\n"
     ]
    }
   ],
   "source": [
    "\n",
    "with open('train-images-idx3-ubyte','rb') as f:\n",
    "    buffer = f.read(4*4)\n",
    "    head = struct.unpack('>iiii',buffer)\n",
    "    print(head)\n",
    "    length = head[1]*head[2]*head[3]\n",
    "    print(length)\n",
    "    buffer = f.read(length)\n",
    "    data_train_imgs = struct.unpack('>{}B'.format(length),buffer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "47040000"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data_train_imgs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tuple"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(data_train_imgs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
